package com.SuanFa.ZuoChengYun;

import java.util.Arrays;
import java.util.Scanner;

public class a3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int a = scan.nextInt();
        int[] nums = new int[2*a];
        for (int i = 0; i < 2*a; i++) {
             nums[i]= scan.nextInt();
        }
        Arrays.sort(nums);
        int temp = 0;
        for (int i = 0; i < a; i++) {
            for (int j = 2*a-1; j >=a; j--) {
                 temp+=i*j;
            }
        }
        System.out.println(temp);
            scan.close();
    }
}
